var name = document.getElementById("name").value;

function submitword(){
    alert(name);
}

function submit(){
    var word = document.getElementById("doc").innerHTML;
    alert(word);
}